package edu.ufl.cise.sanitas.types.data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Class that define a user information.
 */

/**
 * @author tan
 * @version 1.0.1
 * 
 * We add password field in 1.0.1
 *
 */
public class User implements Serializable {
	
	private int userId;
	private String name;
	private String password;
	private String gender;
	private int age;
	private int weight;
	private List<DailyLog> dailyLogList = new ArrayList<DailyLog>();
	private String[] conditions = new String[5];
	
	
	/**
	 * Create a new user
	 * @param userId
	 * @param name
	 * @param password
	 * @param gender
	 * @param age
	 * @param weight
	 * @param conditions
	 */
	public User(int userId, String name, String password, String gender, int age, int weight, String[] conditions) {
		this.userId = -1;	// id is assign by DB, after create a user, should query a id from db
		this.name = name;
		this.password = password;
		this.gender = gender;
		this.age = age;
		this.weight = weight;
		this.conditions = conditions;
	}
	
	public User(String name, String password, String gender, int age) {
		this.userId = -1;
		this.name = name;
		this.password = password;
		this.gender = gender;
		this.age = age;
		this.weight = 0;
		this.conditions = null;
	}
	
	/**
	 * This is for queryUserInfo
	 * @param userId
	 * @param name
	 * @param password
	 * @param gender
	 * @param age
	 */
	
	public User(int userId, String name, String password, String gender, int age) {
		this.userId = userId;
		this.name = name;
		this.password = password;
		this.gender = gender;
		this.age = age;
		this.weight = 0;
		this.conditions = null;
	}
	
	
	
	/**
	 * Add a daily log to the log list
	 * @param dLog
	 */
	public void addLog(DailyLog dLog) {
		dailyLogList.add(dLog);
	}
	
	public List<DailyLog> getLog() {
		return dailyLogList;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	public String[] getConditions() {
		return conditions;
	}

	public void setConditions(String[] conditions) {
		this.conditions = conditions;
	}
	

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public List<DailyLog> getDailyLogList() {
		return dailyLogList;
	}

	public void setDailyLogList(List<DailyLog> dailyLogList) {
		this.dailyLogList = dailyLogList;
	}
}
